import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;

/**
 * to exit the gui
 * 
 * @author Ronny
 * 
 */
public class ExitAction extends AbstractAction {

	private static final long serialVersionUID = 1L;
	private static ExitAction instance = null;
	private static final String NAME = "Exit";
	private KomMap kommap;

	public ExitAction() {
		this.putValue(Action.NAME, NAME);
	}

	/**
	 * 
	 */
	@Override
	public void actionPerformed(ActionEvent e) {

		System.exit(0);
	}

	public ExitAction getInstance(KomMap kommap) {

		kommap.dispose();
		if (instance == null)
			instance = new ExitAction();
		return instance;
	}

}
